package com.cskaoyan.exception;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 创建日期: 2022/05/07 17:14
 *
 * @author shuyang
 */
@RestControllerAdvice
public class ValidationExceptionHandlerAdvice {
    @ExceptionHandler(ValidationException.class)
    public BaseRespVo ValidationExceptionResolver(ValidationException validationException) {
        BaseRespVo baseRespVo = BaseRespVo.invalidData(validationException.getMessage());
        return baseRespVo;
    }
}
